package audio;

import java.io.File;
import javax.swing.filechooser.FileFilter;

/**
 *
 * @author Jeff Hunter, Peter Schilling
 */
public class WavFilter extends FileFilter {

	public boolean accept(File f) {
		if (f.isDirectory())
			return true;

		String extension = null;
		String name = f.getName();

		int i = name.lastIndexOf('.');

		if (i > 0 && i < name.length() - 1)
			extension = name.substring(i + 1).toLowerCase();

		if (extension != null)
			if (extension.equals("wav"))
				return true;
			else
				return false;
		return false;
	}

	public String getDescription() {
		return "wav files";
	}
}
